package com.ruoyi.ora.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.UserFamilyMapper;
import com.ruoyi.ora.domain.UserFamily;
import com.ruoyi.ora.service.IUserFamilyService;

/**
 * 家庭Service业务层处理
 * 
 * @author liuwp
 * @date 2025-03-19
 */
@Service
public class UserFamilyServiceImpl implements IUserFamilyService 
{
    @Autowired
    private UserFamilyMapper userFamilyMapper;

    /**
     * 查询家庭
     * 
     * @param id 家庭主键
     * @return 家庭
     */
    @Override
    public UserFamily selectUserFamilyById(Long id)
    {
        return userFamilyMapper.selectUserFamilyById(id);
    }

    /**
     * 查询家庭列表
     * 
     * @param userFamily 家庭
     * @return 家庭
     */
    @Override
    public List<UserFamily> selectUserFamilyList(UserFamily userFamily)
    {
        return userFamilyMapper.selectUserFamilyList(userFamily);
    }

    /**
     * 根据业务主键查询一条记录：家庭
     *
     * @param userFamily 家庭
     * @return 家庭
     */
    @Override
    public UserFamily selectOneUserFamily(UserFamily userFamily)
    {
        return userFamilyMapper.selectOneUserFamily(userFamily);
    }

    /**
     * 新增家庭
     * 
     * @param userFamily 家庭
     * @return 结果
     */
    @Override
    public int insertUserFamily(UserFamily userFamily)
    {
        userFamily.setCreateTime(DateUtils.getNowDate());
        return userFamilyMapper.insertUserFamily(userFamily);
    }

    /**
     * 修改家庭
     * 
     * @param userFamily 家庭
     * @return 结果
     */
    @Override
    public int updateUserFamily(UserFamily userFamily)
    {
        return userFamilyMapper.updateUserFamily(userFamily);
    }

    @Override
    public int updateUserFamilyCondition(UserFamily userFamily, UserFamily userFamilyCondition)
    {
        return userFamilyMapper.updateUserFamilyCondition(userFamily, userFamilyCondition);
    }

    /**
     * 批量删除家庭
     * 
     * @param ids 需要删除的家庭主键
     * @return 结果
     */
    @Override
    public int deleteUserFamilyByIds(Long[] ids)
    {
        return userFamilyMapper.deleteUserFamilyByIds(ids);
    }

    /**
     * 删除家庭信息
     * 
     * @param id 家庭主键
     * @return 结果
     */
    @Override
    public int deleteUserFamilyById(Long id)
    {
        return userFamilyMapper.deleteUserFamilyById(id);
    }

    /**
     * 条件删除家庭
     *
     * @param userFamily 家庭
     * @return 结果
     */
    @Override
    public int deleteUserFamilyByCondition(UserFamily userFamily)
    {
        return userFamilyMapper.deleteUserFamilyByCondition(userFamily);
    }

}
